package com.carrentalplatform.model;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 车辆实体类
 */
@Data
@TableName("vehicle")
public class Vehicle {

    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("shop_id")
    private Long shopId;

    @TableField("plate_number")
    private String plateNumber;

    private String brand;
    private String model;
    private String color;

    @TableField("seat_count")
    private Integer seatCount;

    @TableField("daily_price")
    private BigDecimal dailyPrice;

    @TableField(value = "status", insertStrategy = FieldStrategy.NOT_NULL)
    private Integer status = 1; // 默认可租用状态 0-维修 1-可租 2-已租

    @TableField("current_location")
    private String currentLocation;

    @TableField("last_maintenance_time")
    private LocalDateTime lastMaintenanceTime;

    @Size(max = 500, message = "图片URL长度不能超过500字符")
    @TableField("image_url")
    private String imageUrl;

    private String description;

    // 删除冗余的licensePlate相关方法
    // 状态常量定义（可选）
    public static final int STATUS_MAINTENANCE = 0;
    public static final int STATUS_AVAILABLE = 1;
    public static final int STATUS_RENTED = 2;
}